﻿#region Using directives

using System;
using System.Collections;
using System.Data;
using UFIDA.U9.UI.PDHelper;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.MD.Runtime.Implement;

#endregion

namespace UFIDA.U9.Cust.U9Demo.DeliverUI
{	public partial class DeliverUIModelModel 
	{
        //初始化UIMODEL之后的方法
        public override  void AfterInitModel()
        {
            //this.Views[0].Fields[0].DefaultValue = thsi.co
            //设置默认组织
            this.Delivery.FieldOrg.DefaultValue = PDContext.Current.OrgRef.ID;
            this.Delivery.FieldOrg_Code.DefaultValue = PDContext.Current.OrgRef.NameColumn;
            this.Delivery.FieldOrg_Name.DefaultValue = PDContext.Current.OrgRef.NameColumn;

            //默认单据日期
            this.Delivery.FieldBusinessDate.DefaultValue = DateTime.Now;
            this.Delivery.FieldOwnOrg.DefaultValue = UFIDA.U9.UI.PDHelper.PDContext.Current.OrgID;
            this.Delivery.FieldOwnOrg_Code.DefaultValue = UFIDA.U9.UI.PDHelper.PDContext.Current.OrgRef.CodeColumn;
            this.Delivery.FieldOwnOrg_Name.DefaultValue = UFIDA.U9.UI.PDHelper.PDContext.Current.OrgRef.NameColumn;
        }
        
        //UIModel提交保存之前的校验操作.
        public override void OnValidate()
        {
        		base.OnValidate() ;
            OnValidate_DefualtImpl();
            //your coustom code ...
        }
	}
}